import 'package:flutter/material.dart';
import 'package:flutter_changdian_football/widget/screenutil/custom_screenutil.dart';

class IconTextWidget extends StatelessWidget {
  const IconTextWidget({
    super.key,
    this.text = '',
    this.icon,
    this.onTap
  });

  final String? text;
  final String? icon;
  final Function? onTap;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      onTap: () {
        onTap?.call();
      },
      child: Column(
        children: [
          SizedBox(
            width: 48.w,
            height: 48.w,
            child: Image.network('$icon', excludeFromSemantics: true, gaplessPlayback: true,),
          ),
          SizedBox(height: 2.w,),
          Text(text ?? '', style: TextStyle(fontSize: 12.sp, color: const Color(0xff666666)),),
        ],
      ),
    );
  }
}